package sa4.Persistence

import org.squeryl.PrimitiveTypeMode._
import org.squeryl.Schema
import org.squeryl.annotations.Column
import org.squeryl.KeyedEntity
import org.squeryl.annotations.OptionType
import org.squeryl.PrimitiveTypeMode._
import org.squeryl.KeyedEntity
import org.squeryl.dsl.ast.LogicalBoolean
import org.squeryl.annotations.OptionType


class User(val name: String, val lastName: String, val email: String, val password: String) extends KeyedEntity[Long] {
  val id = 0L
  def this() = this("", "", "", "")
}

class Brick(val content: String, val userId: Long) extends KeyedEntity[Long] {
  val id = 0L
  def this() = this("", 0L)
}

//class PostedBy(val postedId: Long, val userId: Long, val brickId: Long)

object WallDB extends Schema {
  
  val users = table[User]
  
  on(users)(s=> declare(
      s.email is(unique)))
  
  val bricks = table[Brick]
  //val postedBy = table[PostedBy]
}




